﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Bukstor.Biz;

namespace Bukstor.Admin.UI
{
    public partial class Editoriales : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            ((Label)this.Master.FindControl("lblTitulo")).Text = "EDITORIALES";
            
        }

        protected void btnAlta_Click(object sender, EventArgs e)
        {

        }

        protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            GridViewRow filaEditorial = GridView1.SelectedRow;
            txtEditorial.Text = filaEditorial.Cells[2].Text;
        }

        protected void btnAlta_Click1(object sender, EventArgs e)
        {
            BukstorBDEntities Entidad = new BukstorBDEntities();
            Editorial nuevoEditorial = new Editorial();
            nuevoEditorial.nombre = txtEditorial.Text;
            Entidad.AddToEditoriales(nuevoEditorial);
            Entidad.SaveChanges();
            Response.Redirect("~/Editoriales.aspx");
        }
    }
}
